#!/usr/bin/python
# -*- coding:utf-8 -*-
# @author  : micah
# @time    : 2023/11/15 23:33
# @function: the script is used to do something.
# @version : 

import requests

# 让网站服务器接收到的请求为浏览器请求
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
                  'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36'
}

url = 'https://www.baidu.com'

response = requests.get(url, headers=headers)
# 反爬 请求头
print(response.request.headers)
print(response.content)
